public class Test10 {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder() ;
        stringBuilder.append(1);
        stringBuilder.append(2);
        stringBuilder.deleteCharAt(1);
        System.out.println(stringBuilder);
        class Solution844 {
            public boolean backspaceCompare(String s, String t) {
                char[] arr1 = s.toCharArray() ;
                char[] arr2 = t.toCharArray() ;
                StringBuilder strbu1 = new StringBuilder() ;
                StringBuilder strbu2 = new StringBuilder() ;
                for(char ch : arr1){
                    if(ch == '#'){
                        if(strbu1.length() >= 1){
                            strbu1.deleteCharAt(strbu1.length()-1) ;
                        }
                    }else{
                        strbu1.append(ch) ;
                    }
                }
                for(char ch : arr2){
                    if(ch == '#'){
                        if(strbu2.length() >= 1){
                            strbu2.deleteCharAt(strbu2.length()-1) ;
                        }
                    }else{
                        strbu2.append(ch) ;
                    }
                }

                return strbu1.equals(strbu2) ;
            }
        }
    }
}
